<template>
  <el-form ref="form" :disabled="isReadOnly" :model="headerFormOrigin" label-position="left" label-width="100px">
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="工程名称">
          <el-input v-model="headerFormOrigin.projectName"/>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="生产日期">
          <el-date-picker v-model="headerFormOrigin.date" :editable="false" value-format="yyyy-M-d" type="date"
                          placeholder="选择日期" style="width: 100%;"/>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="机构编号">
          <el-input v-model="headerFormOrigin.orgNum"/>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="产品型号规格">
          <el-input v-model="headerFormOrigin.productModelSpecification"/>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="预投编号">
          <el-input v-model="headerFormOrigin.preNum"/>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="出厂编号">
          <el-input v-model="headerFormOrigin.manuNum"/>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="订单编号">
          <el-input v-model="headerFormOrigin.orderNum"/>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="额定电流Ir">
          <el-select v-model="headerFormOrigin.ratedCurrent" placeholder="请选择">
            <el-option
              v-for="item in headerFormOrigin.ratedCurrentOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="额定短路开断电Isc" label-width="auto">
          <el-select v-model="headerFormOrigin.ratedShortCircuit" placeholder="请选择">
            <el-option
              v-for="item in headerFormOrigin.ratedShortCircuitOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <el-form-item label="相间中心距">
          <custom-radio v-model="headerFormOrigin.centerDist" :labels="headerFormOrigin.centerDistOptions"/>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="操作电压">
          <el-select v-model="headerFormOrigin.operatingVoltage" placeholder="请选择">
            <el-option
              v-for="item in headerFormOrigin.operatingVoltageOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="储能电压">
          <el-select v-model="headerFormOrigin.storageVoltage" placeholder="请选择">
            <el-option
              v-for="item in headerFormOrigin.storageVoltageOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <el-form-item label="配置">
          <el-checkbox-group v-model="headerFormOrigin.config">
            <el-checkbox v-for="(item,index) in headerFormOrigin.configOptions" :key="index" :label="item.value">
              {{ item.label }}
            </el-checkbox>
            <el-input v-model="headerFormOrigin.configCustom" size="mini" style="margin-left:12px;width: 160px;"/>
          </el-checkbox-group>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>
<script>
import CustomRadio from "@/components/CustomRadio/index.vue";
import {handleHeader} from "@/utils/fix/pre";

export default {
  name: "tenkvHeader",
  components: {CustomRadio},
  props: {
    headerFormOrigin: {
      type: Object,
      required: true
    },
    isReadOnly: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {}
  },
  methods: {
    getFormData() {
      return handleHeader(this.headerFormOrigin);
    }
  }
}
</script>
<style scoped lang="scss">

</style>
